Release 10.1A: OpenEdge Data Management:
SQL Development
GRANT statement
The
GRANTstatement can be used to provide the user with database-wide or table-specific privileges. It can also grant public access to restricted columns.Database-wide privileges
Database-wide privileges grant the user
DBA, RESOURCE,AUDIT_ADMIN,AUDIT_ARCHIVE, orAUDIT_INSERTprivileges. Users withDBAprivileges have the ability to access, modify, or delete a database object and to grant privileges to other users.RESOURCEprivileges allow a user to create database objects. Users withAUDIT_ADMINprivileges can read the data of audit-enabled databases. Users withAUDIT_ARCHIVEprivileges can read, archive, and delete audit data. Users withAUDIT_INSERTprivileges can insert application audit events into audit tables. For general information about implementing auditing, see OpenEdge Getting Started: Core Business Services .The
GRANTstatement syntax for grantingRESOURCEorDBAprivileges is:
Note: By employing the
WITH GRANT OPTIONclause, you enable a user to grant the same privilege he or she has been granted to others. This clause should be used carefully due to its ability to affect database security.Example 4–3 demonstrates the use of the
GRANT RESOURCEstatement.
In this case,
GSPis granted the privilege to issueCREATEstatements, and can therefore add objects, such as tables, to the database.Table-specific privileges
Table-specific privileges can be granted to users so they can view, add, delete, or create indexes for data within a table. Privileges can also be granted to allow users to refer to a table from another table’s constraint definitions.
The
GRANTstatement syntax for granting table-specific privileges is:
This is the syntax for the
privilegevalue:
In this instance, a DBA restricts the types of activities a user is allowed to perform on a table. In Example 4–4, '
Note: By employing theGSP' is given permission to update the item name, item number, and catalog descriptions found in the item table.WITH GRANT OPTIONclause, you enable a user to grant the same privilege he or she has been granted to others. This clause should be used carefully due to its ability to affect database security.Example 4–4 illustrates the granting of table-specific privileges.
The
GRANT UPDATEstatement has limitedGSP’s ability to interact with the item table. Now, ifGSPattempts to update a column to which he has not been granted access, the database will return the error message in Example 4–5.
Granting public access
The
GRANTstatement can be easily modified to make previously restricted columns accessible to the public, as in Example 4–6.
For detailed information on the
GRANTstatement, see OpenEdge Data Management: SQL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |